#ifndef _GAME_H_
#define _GAME_H_

#include "Player.hpp"
#include "Board.hpp"

using namespace apng::checkers::player;
using namespace apng::checkers::board;

namespace apng {

	namespace checkers {

		namespace game {

			class Game {

				private:

					Player* player1;
					Player* player2;
					Board* board;
					PlayerType currentPlayer;

				public:

					Game();
					virtual ~Game();
					Game(int width, int heithg);

					void setPlayer(Player* player, apng::checkers::player::PlayerType type);
					Player* getPlayer(apng::checkers::player::PlayerType type) const;
					PlayerType getPlayerType(Player* player) const;

					void changeCurrentPlayer(void);
					void changeCurrentPlayer(apng::checkers::player::PlayerType type);

					Board* getBoard(void) const;
					void setBoard(Board* board);

					bool verifyWinner(void) const;
					Player* getWinner(void) const;

					bool verifyMove(unsigned int fromx, unsigned int fromy, unsigned int tox, unsigned int toy) const;

					bool movePiece(unsigned int fromx, unsigned int fromy, unsigned int tox, unsigned int toy) const;
			};
		}
	}
}

#endif
